from Holiday import Holiday

class RepeatingHoliday (Holiday):
    '''
    Class to represent holidays that happen on the same day each year
    '''

    def __init__ (self, description, month, day):
        Holiday.__init__(self, description)
        self.day = day
        self.month = month
        
    def __eq__(self, other):
        return (self.day == other.day) and (self.month == other.month)
        
    def __repr__(self):
        return "<RepeatingHoliday(%d,%d)>" % (self.day, self.month)

    def get_day(self):
        return self.day
    
    def isholiday (self, when):
        return self.month == when.month and self.day == when.day
    
    def text (self):
        return "%d-%d" % (self.day, self.month)
    
    def type ():
        return "Repeating"
    
    type = staticmethod (type)
